#!/bin/sh
###########################################
# This file is not meant to be directly executed by end user.
#

command=$1
string=$2
locale=$3

string=`echo $string | sed -e 's/ˊ/2/'`
string=`echo $string | sed -e 's/ˇ/3/'`
string=`echo $string | sed -e 's/ˋ/4/'`
string=`echo $string | sed -e 's/˙/1/'`
phoneFile=ogg/${string}/3.ogg
phoneDir=$COMMON_TTS_VSRC_DIR/Gcin

case $command in
    CanPronounce)
	if [ -r ${phoneDir}/${phoneFile} ];then
	    exit 0
	fi
	exit 1
	;;
    Pronounce)
	$COMMON_TTS_BIN_DIR/ctts-player ${phoneDir}/${phoneFile} audio/ogg
	exit $?
	;;
    CanSay)
	exit 2
	;;
    Say)
	exit 2
	;;
    *)
	echo "Usage: $0 <CanPronounce|Pronounce> <Phonetic>"
	echo "       $0 <CanSay|Say> <Word>"
	exit -1
	;;
esac

